




/**
* @file snd.c
* @brief 测试
* @author zshare
* @version v1.0
* @date 2022-03-11
* @history  
*	
*	
*/


#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "msg.h"

#define BOB	0x01
#define MSG_TYPE_STATE	0x01

int main(){
	u8 data[4] = { 0x01, 0x02, 0x03, 0x04};
	msg_st *msg = nil;
	int fd = open(test_rev_chan, O_RDWR);//以可读可写方式打开

	if(fd < 0){
		log_print("open failed.\n");
		return -1;
	}

	pack_msg(fd, BOB, 0, MSG_TYPE_STATE, 4, data, &msg);
	write(fd, msg, 1);

	close(fd);
	return 0;
}



















